package com.jbm.jsm.iface;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
 * Created by root on 17-11-7.
 */
@Entity
@Table(name = "alipay_cache", schema = "jsm", catalog = "")
public class AlipayCacheEntity
{
	private int acId;
	private String alipayCode;
	private BigDecimal amount;
	private String memo;
	private int ver;
	private String status;
	private String mem;
	private Timestamp createDate;

	@Id
	@Column(name = "ac_id", nullable = false)
	public int getAcId()
	{
		return acId;
	}

	public void setAcId(int acId)
	{
		this.acId = acId;
	}

	@Basic
	@Column(name = "alipay_code", nullable = false, length = 40)
	public String getAlipayCode()
	{
		return alipayCode;
	}

	public void setAlipayCode(String alipayCode)
	{
		this.alipayCode = alipayCode;
	}

	@Basic
	@Column(name = "amount", nullable = false, precision = 4)
	public BigDecimal getAmount()
	{
		return amount;
	}

	public void setAmount(BigDecimal amount)
	{
		this.amount = amount;
	}

	@Basic
	@Column(name = "memo", nullable = false, length = 40)
	public String getMemo()
	{
		return memo;
	}

	public void setMemo(String memo)
	{
		this.memo = memo;
	}

	@Basic
	@Column(name = "ver", nullable = false)
	public int getVer()
	{
		return ver;
	}

	public void setVer(int ver)
	{
		this.ver = ver;
	}

	@Basic
	@Column(name = "status", nullable = true, length = 10)
	public String getStatus()
	{
		return status;
	}

	public void setStatus(String status)
	{
		this.status = status;
	}

	@Basic
	@Column(name = "mem", nullable = true, length = 500)
	public String getMem()
	{
		return mem;
	}

	public void setMem(String mem)
	{
		this.mem = mem;
	}

	@Basic
	@Column(name = "create_date")
	public Timestamp getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Timestamp createDate) {
		this.createDate = createDate;
	}

	@Override
	public boolean equals(Object o)
	{
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		AlipayCacheEntity that = (AlipayCacheEntity) o;

		if (acId != that.acId) return false;
		if (ver != that.ver) return false;
		if (alipayCode != null ? !alipayCode.equals(that.alipayCode) : that.alipayCode != null) return false;
		if (amount != null ? !amount.equals(that.amount) : that.amount != null) return false;
		if (memo != null ? !memo.equals(that.memo) : that.memo != null) return false;
		if (status != null ? !status.equals(that.status) : that.status != null) return false;
		if (mem != null ? !mem.equals(that.mem) : that.mem != null) return false;

		return true;
	}

	@Override
	public int hashCode()
	{
		int result = acId;
		result = 31 * result + (alipayCode != null ? alipayCode.hashCode() : 0);
		result = 31 * result + (amount != null ? amount.hashCode() : 0);
		result = 31 * result + (memo != null ? memo.hashCode() : 0);
		result = 31 * result + ver;
		result = 31 * result + (status != null ? status.hashCode() : 0);
		result = 31 * result + (mem != null ? mem.hashCode() : 0);
		return result;
	}
}
